import { CourseSlot } from '../../types/courseSlot'
import { Page, PageReq } from '../../types/page'
import { CourseSlotDao } from '../dao/courseSlotDao'

export class CourseSlotService {
  /**
   * 创建排课课程
   */
  static async create(courseSlot: Omit<CourseSlot, 'id'>): Promise<number | undefined> {
    return CourseSlotDao.create(courseSlot)
  }

  /**
   * 更新排课课程
   */
  static async update(id: number, courseSlot: Partial<CourseSlot>): Promise<void> {
    return CourseSlotDao.update(id, courseSlot)
  }

  /**
   * 删除排课课程
   */
  static async delete(id: number): Promise<void> {
    return CourseSlotDao.delete(id)
  }

  /**
   * 获取排课课程详情
   */
  static async getById(id: number): Promise<CourseSlot | null> {
    return CourseSlotDao.getById(id)
  }

  /**
   * 获取排课课程列表
   */
  static async list(): Promise<CourseSlot[]> {
    return CourseSlotDao.list()
  }

  /**
   * 分页查询排课课程列表
   */
  static async page(params: PageReq<CourseSlot>): Promise<Page<CourseSlot>> {
    return CourseSlotDao.page(params)
  }
}